﻿using System.Collections.Generic;
using System.Windows;

namespace VirtualTileTest2 {
    /// <summary>
    /// MainWindow.xaml の相互作用ロジック
    /// </summary>
    public partial class MainWindow : Window {
        private List<TiledImageItem> mTileItems = new List<TiledImageItem>();
        private Size mTileSize = new Size(256, 256);
        private ContentsList mContentsList;
        
        public MainWindow() {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e) {
            mContentsList = new ContentsList();

            TiledImageItem.UpdateTileSize(mTileSize);

            virtualizingTile.UpdateTileSize(mTileSize);
            for (int i=0; i < mContentsList.Count; ++i) {
                var tileItem = new TiledImageItem(mContentsList.ContentNth(i));

                virtualizingTile.AddVirtualChild(tileItem);
                mTileItems.Add(tileItem);
            }
            virtualizingTile.UpdateChildPosition();
        }
    }
}
